﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace ValidateNumbers
{
    class validateNumbers
    {
        static void Main(string[] args)
        {
            string[] tests = {"-0", "33", "-2381.78132","4.3347", "12.00", "0.34" ,"+3", "24", "543", "01.23", "12.", "11,23", "--2", ".25", "-.25" ,"12е7"}; 

            string integerNumbers = @"\A-?[1-9][0-9]*\Z";
            string realNumbers = @"\A(-)?(0|[1-9][0-9]*)\.[0-9]+\Z";
            foreach(var number in tests)
            {
                Match integerMatcher = Regex.Match(number, integerNumbers);
                if (integerMatcher.Success) 
                {
                    Console.WriteLine("{0} is integer",integerMatcher);
                }
            }

            foreach (var number in tests) 
            {
                Match realNumberMatcher = Regex.Match(number,realNumbers);
                if (realNumberMatcher.Success) 
                {
                    Console.WriteLine("{0} is real",realNumberMatcher);
                }
            }
        }
    }
}
